﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;

namespace BreadWebAPI.Models
{
    public class Utils
    {
        public static string GetShortNavUrl(DateTime date)
        {
            StringBuilder urlToNavigate = new StringBuilder(date.Year.ToString(), 20);
            urlToNavigate.Append('-');
            if (date.Month < 10)
                urlToNavigate.Append('0');
            urlToNavigate.Append(date.Month);
            urlToNavigate.Append('-');
            if (date.Day < 10)
                urlToNavigate.Append('0');
            urlToNavigate.Append(date.Day);
            return urlToNavigate.ToString();
        }
    }
}